﻿using System;
using System.Collections;
using System.Configuration;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using KPIS.GERP.GBMS.BLL;
using KPIS.GERP.GBMS.IBLL;
using KPIS.GERP.GBMS.MODEL;
using Telerik.Web.UI;


namespace KPIS.GERP.GBMS.APP_UI
{
    public partial class TreeViewOption : System.Web.UI.UserControl
    {
        private IOptionBLL optCtrl = new OptionBLL();
        public event RadTreeViewEventHandler TreeNodeClick;
        private int type;

        public int OptionType
        {
            get { return type; }
            set { type = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        public void LoadTreeView()
        {
            tView.DataSource = optCtrl.TreeView(type);
            tView.DataBind();
        }

        protected void tView_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            OnNodeClick(e);
        }

        protected void tView_DataBinding(object sender, EventArgs e)
        {

        }

        protected void OnNodeClick(RadTreeNodeEventArgs e)
        {
            if (TreeNodeClick != null)
            {
                TreeNodeClick(this, e);
            }
        }
    }
}